/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Administration;

import pojo.hibernate.Statemaster;
import pojo.hibernate.StatemasterDAO;
import pojo.hibernate.Institutiontype;
import pojo.hibernate.InstitutiontypeDAO;
import pojo.hibernate.Institutionmaster;
import pojo.hibernate.InstitutionmasterDAO;

import utils.DevelopmentSupport;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author kazim
 */
public class InstitutionIndexAction extends DevelopmentSupport {
    private Institutionmaster  im;
    private InstitutionmasterDAO imDao = new InstitutionmasterDAO();
    private List<Statemaster> statemasterList = new ArrayList<Statemaster>();
    private List<Institutiontype> institutiontypeList = new ArrayList<Institutiontype>();
    private String message;
    private String EntryMode = "false";
    private Short ImId;
    
    public String getMessage() {
        return message;
    }

      public String getEntryMode() {
        return EntryMode;
    }

    public void setEntryMode(String EntryMode) {
        this.EntryMode = EntryMode;
    }

    public List<Statemaster> getStatemasterList() {
        return statemasterList;
    }
    public void setStatemasterList(List<Statemaster> statemasterList) {
        this.statemasterList = statemasterList;
    }

    public List<Institutiontype> getInstitutiontypeList() {
        return institutiontypeList;
    }
    public void setInstitutiontypeList(List<Institutiontype> institutiontypeList) {
        this.institutiontypeList = institutiontypeList;
    }

     public Short getImId() {
        return ImId;
    }

     public void  setImId(Short ImId) {
        this.ImId = ImId;
    }
     
    @Override
    public String execute() throws Exception {       
        try {       
        StatemasterDAO stateDao = new StatemasterDAO();
        statemasterList = stateDao.findAll();

        InstitutiontypeDAO institutiontypeDao = new InstitutiontypeDAO();
        institutiontypeList = institutiontypeDao.findAll();

        return SUCCESS;
        }
        catch (Exception e)
        { message = message + e.getMessage();
                  return ERROR;
        }

    }
}